/*
 * Activity.cpp
 *
 *  Created on: 2021年9月6日
 *      Author: vicent-PC
 */
#define LOG_TAG "Activity"
#include "Activity.h"

#include <Trace.h>
#include <stdio.h>

Activity::Activity() : mSurface(nullptr) {
    onCreate();
    handleResumeActivity();
}

Activity::~Activity() {
    if (mSurface != nullptr) {
        delete mSurface;
        mSurface = nullptr;
    }
}

void Activity::onCreate() {}

void Activity::onEvent() {}

void Activity::requestLayout() {
    mSurface = new Surface();
}

void Activity::setContentView(View* view) {
    mContentView = view;
}

void Activity::handleResumeActivity() {
    requestLayout();
    invalidate();
    onDraw();
}

void Activity::invalidate() { TRACE_B(); }

void Activity::onDraw() { TRACE_B(); }
